/*
 * Created by JFormDesigner on Thu Nov 27 10:24:15 CST 2008
 */

package hydraperf.adminconsole.gui;

import info.clearthought.layout.TableLayout;
import info.clearthought.layout.TableLayoutConstraints;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.util.ResourceBundle;

/**
 * @author Christopher Bartling
 */
public class MainFrame extends JFrame {

    public MainFrame() {
        initComponents();
    }

    private void exitMenuItemActionPerformed(ActionEvent e) {
        System.exit(0);
    }

    private void startButtonActionPerformed(ActionEvent e) {
        // TODO add your code here
    }

    private void stopButtonActionPerformed(ActionEvent e) {
        // TODO add your code here
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        // Generated using JFormDesigner non-commercial license
        ResourceBundle bundle = ResourceBundle.getBundle("hydraperf.adminconsole.gui.messages");
        mainMenuBar = new JMenuBar();
        fileMenu = new JMenu();
        exitMenuItem = new JMenuItem();
        toolBar = new JToolBar();
        startButton = new JButton();
        stopButton = new JButton();
        splitPane1 = new JSplitPane();
        panel1 = new JPanel();

        //======== this ========
        setTitle(bundle.getString("MainFrame.this.title"));
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        Container contentPane = getContentPane();
        contentPane.setLayout(new TableLayout(new double[][] {
            {TableLayout.PREFERRED, TableLayout.FILL},
            {TableLayout.PREFERRED, TableLayout.FILL, TableLayout.PREFERRED}}));
        ((TableLayout)contentPane.getLayout()).setHGap(5);
        ((TableLayout)contentPane.getLayout()).setVGap(5);

        //======== mainMenuBar ========
        {

            //======== fileMenu ========
            {
                fileMenu.setText(bundle.getString("MainFrame.fileMenu.text"));
                fileMenu.setMnemonic(bundle.getString("MainFrame.fileMenu.mnemonic").charAt(0));

                //---- exitMenuItem ----
                exitMenuItem.setText(bundle.getString("MainFrame.exitMenuItem.text"));
                exitMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.META_MASK));
                exitMenuItem.setMnemonic(bundle.getString("MainFrame.exitMenuItem.mnemonic").charAt(0));
                exitMenuItem.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        exitMenuItemActionPerformed(e);
                    }
                });
                fileMenu.add(exitMenuItem);
            }
            mainMenuBar.add(fileMenu);
        }
        setJMenuBar(mainMenuBar);

        //======== toolBar ========
        {

            //---- startButton ----
            startButton.setText(bundle.getString("MainFrame.startButton.text"));
            startButton.setIcon(new ImageIcon(getClass().getResource("/hydraperf/adminconsole/gui/images/control_play_blue.png")));
            startButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    startButtonActionPerformed(e);
                }
            });
            toolBar.add(startButton);

            //---- stopButton ----
            stopButton.setText(bundle.getString("MainFrame.stopButton.text"));
            stopButton.setIcon(new ImageIcon(getClass().getResource("/hydraperf/adminconsole/gui/images/control_stop_blue.png")));
            stopButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    stopButtonActionPerformed(e);
                }
            });
            toolBar.add(stopButton);
        }
        contentPane.add(toolBar, new TableLayoutConstraints(0, 0, 1, 0, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL));
        contentPane.add(splitPane1, new TableLayoutConstraints(0, 1, 1, 1, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL));

        //======== panel1 ========
        {
            panel1.setLayout(new FlowLayout());
        }
        contentPane.add(panel1, new TableLayoutConstraints(0, 2, 1, 2, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL));
        pack();
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
    // Generated using JFormDesigner non-commercial license
    private JMenuBar mainMenuBar;
    private JMenu fileMenu;
    private JMenuItem exitMenuItem;
    private JToolBar toolBar;
    private JButton startButton;
    private JButton stopButton;
    private JSplitPane splitPane1;
    private JPanel panel1;
    // JFormDesigner - End of variables declaration  //GEN-END:variables
}
